#include <bits/stdc++.h>
#define rep(i, l, r) for(int i = l; i <= r; i++)
#define int long long
using namespace std;
const int MN = 1e5 + 5;
//Bocchi The Rock!!!
int a[MN];
signed main() {
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    int N, r = 1;
    cin >> N;
    rep(i, 1, N) cin >> a[i];
    sort(a + 1, a + N + 1);
    int res = 0;
    rep(i, 1, N) {
        r = max(i, r);
        while(r <= N && a[i] == a[r]) r++;
        if(r == N + 1) break;
        res++;
        r++;
    }
    cout << N - res << endl;
    return 0;
}